//
//  BaseViewController.m
//  GoTraveling
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
    
    self.navigationController.navigationBar.translucent = NO;
    
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.18 green:0.21 blue:0.24 alpha:1];
    
    //去掉线
    if ([self.navigationController.navigationBar respondsToSelector:@selector( setBackgroundImage:forBarMetrics:)]){
        NSArray *list=self.navigationController.navigationBar.subviews;
        for (id obj in list) {
            if ([obj isKindOfClass:[UIImageView class]]) {
                UIImageView *imageView=(UIImageView *)obj;
                NSArray *list2=imageView.subviews;
                for (id obj2 in list2) {
                    if ([obj2 isKindOfClass:[UIImageView class]]) {
                        UIImageView *imageView2=(UIImageView *)obj2;
                        imageView2.hidden=YES;
                    }
                }
            }
        }
    }
    
    //夜间
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"states"] isEqualToString:@"1"]) {
        
        self.view.backgroundColor = [UIColor colorWithRed:0.15 green:0.14 blue:0.16 alpha:1];
    }
    else {
        
        self.view.backgroundColor = [UIColor colorWithRed:0.980 green:0.961 blue:0.910 alpha:1.000];
    }
    
    self.getDataBtn = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.getDataBtn.backgroundColor = [UIColor colorWithRed:0.980 green:0.961 blue:0.910 alpha:1.000];
    [self.view addSubview:self.getDataBtn];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
    [self.getDataBtn addGestureRecognizer:tap];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 50)];
    label.center = CGPointMake(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - 50);
    label.textAlignment = NSTextAlignmentCenter;
    label.text = @"点击刷新";
    label.textColor = [UIColor colorWithRed:0.3 green:0.3 blue:0.31 alpha:1];
    label.userInteractionEnabled = YES;
    [self.getDataBtn addSubview:label];
}

- (void)tapAction:(UITapGestureRecognizer *)button {
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
